.class Lcom/xingbook/service/download/d;
.super Landroid/os/Handler;


# instance fields
.field private a:Ljava/lang/ref/WeakReference;


# direct methods
.method constructor <init>(Lcom/xingbook/service/download/b;)V
    .locals 1

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/xingbook/service/download/d;->a:Ljava/lang/ref/WeakReference;

    return-void
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 11

    const v10, 0x7f08001c

    const/4 v7, 0x6

    const/4 v8, 0x5

    const/4 v9, 0x0

    iget-object v0, p0, Lcom/xingbook/service/download/d;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/b;

    invoke-virtual {v0}, Lcom/xingbook/service/download/b;->c()Lcom/xingbook/service/download/a;

    move-result-object v2

    invoke-virtual {v0}, Lcom/xingbook/service/download/b;->f()Ljava/util/ArrayList;

    move-result-object v3

    invoke-virtual {v0}, Lcom/xingbook/service/download/b;->g()Ljava/util/ArrayList;

    move-result-object v4

    invoke-virtual {v0}, Lcom/xingbook/service/download/b;->b()Landroid/content/Context;

    move-result-object v5

    invoke-virtual {v0}, Lcom/xingbook/service/download/b;->a()Lcom/xingbook/service/download/e;

    move-result-object v6

    iget v1, p1, Landroid/os/Message;->what:I

    packed-switch v1, :pswitch_data_0

    :cond_0
    :goto_0
    :pswitch_0
    return-void

    :pswitch_1
    iget-object v1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v1, Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/xingbook/service/download/b;->d(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    if-eqz v0, :cond_0

    iget v1, p1, Landroid/os/Message;->arg2:I

    int-to-long v1, v1

    invoke-virtual {v0, v1, v2}, Lcom/xingbook/service/download/k;->b(J)V

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_0

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/m;

    iget-object v1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v1, Ljava/lang/String;

    iget v3, p1, Landroid/os/Message;->arg1:I

    invoke-interface {v0, v1, v3}, Lcom/xingbook/service/download/m;->b(Ljava/lang/String;I)V

    goto :goto_1

    :pswitch_2
    iget-object v1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v1, Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/xingbook/service/download/b;->d(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v5

    iget v7, p1, Landroid/os/Message;->arg1:I

    if-eqz v5, :cond_0

    invoke-virtual {v5, v7}, Lcom/xingbook/service/download/k;->a(I)V

    if-ne v7, v8, :cond_4

    invoke-virtual {v4, v5}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    if-eqz v6, :cond_1

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v0

    invoke-interface {v6, v0}, Lcom/xingbook/service/download/e;->a(I)V

    :cond_1
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_2

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_2
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_3

    :cond_2
    if-eqz v2, :cond_0

    invoke-virtual {v5}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    invoke-interface {v2, v1, v0, v7}, Lcom/xingbook/service/download/a;->a(Ljava/lang/String;II)V

    goto :goto_0

    :cond_3
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/m;

    invoke-interface {v0}, Lcom/xingbook/service/download/m;->a_()V

    invoke-interface {v0, v1, v7}, Lcom/xingbook/service/download/m;->a(Ljava/lang/String;I)V

    goto :goto_2

    :cond_4
    const/4 v0, 0x3

    if-ne v7, v0, :cond_5

    iget v0, p1, Landroid/os/Message;->arg2:I

    int-to-long v8, v0

    invoke-virtual {v5, v8, v9}, Lcom/xingbook/service/download/k;->a(J)V

    :cond_5
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_6

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_3
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_7

    :cond_6
    if-eqz v2, :cond_0

    invoke-virtual {v5}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    invoke-interface {v2, v1, v0, v7}, Lcom/xingbook/service/download/a;->a(Ljava/lang/String;II)V

    goto/16 :goto_0

    :cond_7
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/m;

    invoke-interface {v0, v1, v7}, Lcom/xingbook/service/download/m;->a(Ljava/lang/String;I)V

    goto :goto_3

    :pswitch_3
    iget-object v1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v1, Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/xingbook/service/download/b;->d(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v4

    iget v6, p1, Landroid/os/Message;->arg1:I

    if-eqz v4, :cond_0

    invoke-virtual {v4, v7}, Lcom/xingbook/service/download/k;->a(I)V

    packed-switch v6, :pswitch_data_1

    const v0, 0x7f08005d

    invoke-static {v5, v0, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    :goto_4
    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_8

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_5
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_9

    :cond_8
    if-eqz v2, :cond_0

    invoke-virtual {v4}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    invoke-interface {v2, v1, v0, v7}, Lcom/xingbook/service/download/a;->a(Ljava/lang/String;II)V

    goto/16 :goto_0

    :pswitch_4
    const v0, 0x7f08001b

    invoke-static {v5, v0, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    goto :goto_4

    :pswitch_5
    invoke-static {v5, v10, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    goto :goto_4

    :pswitch_6
    invoke-static {v5, v10, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    goto :goto_4

    :pswitch_7
    const v0, 0x7f08001d

    invoke-static {v5, v0, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    goto :goto_4

    :pswitch_8
    const v0, 0x7f08001e

    invoke-static {v5, v0, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    goto :goto_4

    :pswitch_9
    const v0, 0x7f080020

    invoke-static {v5, v0, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    goto :goto_4

    :pswitch_a
    const v0, 0x7f08001f

    invoke-static {v5, v0, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    goto :goto_4

    :cond_9
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/m;

    invoke-interface {v0, v1, v6}, Lcom/xingbook/service/download/m;->c(Ljava/lang/String;I)V

    goto :goto_5

    :pswitch_b
    invoke-virtual {v4}, Ljava/util/ArrayList;->clear()V

    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Ljava/util/Collection;

    invoke-virtual {v4, v0}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_0

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_6
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/m;

    invoke-interface {v0}, Lcom/xingbook/service/download/m;->a_()V

    goto :goto_6

    :pswitch_c
    iget-object v1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v1, Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/xingbook/service/download/b;->d(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v7

    if-eqz v7, :cond_0

    invoke-virtual {v7}, Lcom/xingbook/service/download/k;->b()I

    move-result v0

    if-eq v0, v8, :cond_a

    if-eqz v2, :cond_a

    invoke-virtual {v7}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    const/4 v8, 0x7

    invoke-interface {v2, v1, v0, v8}, Lcom/xingbook/service/download/a;->a(Ljava/lang/String;II)V

    :cond_a
    invoke-virtual {v4, v7}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    if-eqz v6, :cond_b

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v0

    invoke-interface {v6, v0}, Lcom/xingbook/service/download/e;->a(I)V

    :cond_b
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_c

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_7
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_e

    :cond_c
    invoke-virtual {v7}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    const/4 v1, 0x1

    if-eq v0, v1, :cond_d

    invoke-virtual {v7}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    const/4 v1, 0x2

    if-ne v0, v1, :cond_0

    :cond_d
    const v0, 0x7f08005a

    invoke-static {v5, v0, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    goto/16 :goto_0

    :cond_e
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/m;

    invoke-interface {v0}, Lcom/xingbook/service/download/m;->a_()V

    goto :goto_7

    :pswitch_d
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_0

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_8
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/m;

    iget-object v1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v1, Ljava/lang/String;

    invoke-interface {v0, v1}, Lcom/xingbook/service/download/m;->b_(Ljava/lang/String;)V

    goto :goto_8

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_b
        :pswitch_0
        :pswitch_c
        :pswitch_2
        :pswitch_1
        :pswitch_3
        :pswitch_d
    .end packed-switch

    :pswitch_data_1
    .packed-switch 0x1
        :pswitch_7
        :pswitch_a
        :pswitch_9
        :pswitch_8
        :pswitch_a
        :pswitch_4
        :pswitch_5
        :pswitch_6
    .end packed-switch
.end method
